﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace UCF.Core.Web.Demo
{
    /// <summary>
    /// 演示会话浏览记录类 [2012-6-5]
    /// </summary>
    public class DemoSessionHistory : SessionDataTable
    {
        public DemoSessionHistory(string name = "his", int count = 10)
            : base(name, count: count)
        {
            base.SetColumnsName("id", "name", "price", "number", "thumb");
        }

        /// <summary>
        /// 添加到购物车
        /// <para>0=id,1=name,2=price,3=number,4=thumb,others</para>
        /// </summary>
        /// <param name="id">编号</param>
        /// <param name="name">名称</param>
        /// <param name="price">价格</param>
        /// <param name="number">数量</param>
        /// <param name="thumb">缩略图</param>
        /// <param name="others">其他信息</param>
        public void Add(object id, string name, decimal price, int number, string thumb, params object[] others)
        {
            IList<object> list = new List<object>();
            list.AddRangeR(id, name, price, number, thumb);
            if (others.Length > 0) list.AddRangeR(others);
            base.Add(list.ToArray());
        }
    }
}
